<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" version="2.0">
	<jsp:directive.page contentType="text/html; charset=ISO-8859-1"
		pageEncoding="ISO-8859-1" session="false" />
	<jsp:output doctype-root-element="html"
		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
		omit-xml-declaration="true" />
	<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<title>Product List</title>
			<link href="css/style.css" rel="stylesheet" type="text/css"></link>
		</head>
		<body style="text-align: center">
			<div style="text-align: left">
				<h1>List of Product</h1>
				<table>
					<tr class="headerTable">
						<td>Category</td>
						<td>Name</td>
						<td>Picture</td>
						<td>Price</td>
						<td>Seller's Comment</td>
						<td>&#160;</td>
						<td>&#160;</td>
					</tr>
					<c:forEach var="product" items="${products}" varStatus="rowCounter">
						 <c:choose>
							<c:when test="${rowCounter.count % 2 == 0}">
								<c:set var="rowStyle" scope="page" value="odd" />
							</c:when>
							<c:otherwise>
								<c:set var="rowStyle" scope="page" value="even" />
							</c:otherwise>
						</c:choose>
						<tr class="{rowStyle}">
							<td>${product.category}</td>
							<td>${product.name}</td>
							<td>${product.picture}</td>
							<td><fmt:formatNumber type="number" pattern="###,###.00" value="${product.price}" /></td>
							<td>${product.comment}</td>
							<td><a href="viewProduct?id=${product.productId}">Edit</a></td>
							<td><a href="deleteProduct?id=${product.productId}">Delete</a></td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</body>
	</html>
</jsp:root>